import { CreateDailyDto } from "@/interface/user";
import request from "@/utils/axios";

export function createDaily(data: CreateDailyDto): Promise<any> {
  return request({
    url: "/daily",
    method: "post",
    data
  });
}

export function getDaily(userId?: number): Promise<any> {
  return request({
    url: '/daily' + (userId ? '?userId=' + userId : ''),
    method: "get",
  });
}

export function deleteDailyById(id: number): Promise<any> {
  return request({
    url: '/daily/' + id,
    method: "delete",
  });
}